T = [n * (n + 1) // 2 for n in range(285, 100000)]
P = [n * (3 * n - 1) // 2 for n in range(165, 100000)]  # 差值大遍历这个
H = [n * (2 * n - 1) for n in range(143, 100000)]
for i in H:
    if i in T and i in P:
        print(i)
